package com.media.feignclient;

import com.base.model.R;
import com.media.model.Media;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@FeignClient(name = "search-api",value = "search-api", fallbackFactory = MediaSearchClientFactory.class)
public interface MediaSearchClient {

    @DeleteMapping("/search/deleteMedia")
    public R<String> deleteMediaByMediaId(@RequestParam("mediaId") String mediaId);

    @GetMapping("/search/listBySearchBox")
    public R<List<Media>> listMediaBySearchBox(@RequestParam("searchContext") String searchContext, @RequestParam("orderBy") Integer orderCode, @RequestParam("page") Integer page, @RequestParam("category") Integer category, @RequestParam("timeCode") Integer timeCode) ;

    @PutMapping("/addMedia")
    public R<String> saveMedia(@RequestBody Media media);


}
